
#include "stdio.h"
#include "src/Tween.h"

using namespace tween;


class TestTarget :public ITarget
{
public: // static
	static const std::string X;
	static const std::string Y;
	static const std::string SpriteFrame;

public:// member
	void* spriteFrame;
	float x;
	float y;

public:
	TestTarget() :x(0), y(0), spriteFrame(nullptr) {};
	~TestTarget() {};

	virtual float	getNumber(const std::string& name) {
		if (name == TestTarget::X) {
			return this->x;
		}
		else {
			if (name == TestTarget::Y) {
				return this->y;
			}
		}
		return 0.0f;
	};
	virtual void	setNumber(const std::string& name, float num) {
		if (name == TestTarget::X) {
			this->x = num;
		}
		else {
			if (name == TestTarget::Y) {
				this->y = num;
			}
		}
	};
	virtual void*	getPointer(const std::string& name) {
		if (name == TestTarget::SpriteFrame) {
			return this->spriteFrame;
		}
		return nullptr;
	};
	virtual void	setPointer(const std::string& name, void* p) {
		if (name == TestTarget::SpriteFrame) {
			this->spriteFrame = p;
		}
	};
};
const  std::string TestTarget::X = "x";
const  std::string TestTarget::Y = "y";
const  std::string TestTarget::SpriteFrame = "spriteFrame";


int main()
{
	TestTarget target;

	std::vector<ActionData> frames;

	for (size_t i = 0; i < 1; i++)
	{
		ActionData d1 = ActionData(ActionType::RelNum, 0.1f * i, 1.0f, TestTarget::X, nullptr);
		d1.v.num = 100;
		frames.push_back(d1);
	}

	{
		TweenOptions option;
		option.timeScale = 0;
		Tween* t = new Tween(&target, frames, option);
		t->advance(0.1f);
		int a = 0;
	}

	int a = 0;
}

